#include<iostream>
#include<string>
#include<pthread.h>
#include<unistd.h>
using std::cout;
using std::endl;
using std::string;
void TidPrint(const char* str,const pthread_t tid)
{
    cout<<"Thread Name::"<<str<<"ID::"<<tid<<endl;
}
void* tidFun(void* agrc)
{
    char* str=(char*)agrc;
    while(1)
    {
        TidPrint(str,pthread_self());
        sleep(1);
    }
}
int main()
{
    pthread_t tid;
    pthread_create(&tid,nullptr,tidFun,(void*)"I am thread!");
    while(1)
    {
        cout<<"process pid::"<<getpid()<<endl;
        TidPrint("Main thread",pthread_self());
        sleep(1);
    }

    return 0;
}
